<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:fb="http://www.facebook.com/2008/fbml">
	<head>
		<title>Read Article</title>
		<%@include file="/jsp/public/css_includes.jsp" %>
	</head>
	<body>
		
		<div id="container">
			<div id="fb-root"></div>
			
			<%@include file="/jsp/public/header.jsp" %>
			<%@include file="/jsp/reader/readArticle_menubar.jsp" %>
			
			<div id="sub_container"> 
				<div class="content">
					<div class="articlesInfo">
						
<!--								<a class="previewButton" href="/article/preview/${art.id}">-->
<!--								<button class="portfolioSubmitButton">Preview</button></a> -->
<!--								<form action="/article/publish/${art.id}" method="post">-->
<!--								<h2 class="portfolioArticleTitle">${art.dc.title}</h2>-->
<!--								<h2 class="portfolioArticleAbstract">${art.dc.description}</h2>-->
								
								
								<c:forEach items="${articles}" var="art">
							<div class="articleInfo">

					
								<form action="/article/publish/${art.id}" method="post">
								<h2 class="portfolioArticleTitle">${art.dc.title}</h2>
								<h2 class="portfolioArticleAbstract">${art.dc.description}</h2>

								<a class="previewButton" href="/article/preview/${art.id}">
								<button class="portfolioSubmitButton">Preview</button></a> 
								<c:choose>
									<c:when test="${art.published}">
								
									</c:when>
							
									<c:otherwise>
										<a class="publishButton">
										<button class="portfolioSubmitButton" type="submit">Publicar</button>
										</a>
										<a class="modifyButton" href="/article/modify/${art.id}">
										<button class="portfolioSubmitButton">Modificar</button>
										</a>
										<a class="deleteButton" href="/article/delete/${art.id}">
										<button class="portfolioSubmitButton">Delete</button>
										</a>
							
								</c:otherwise>
							</c:choose>
							</form>
						</div>
						
					</c:forEach></div>
					
					
					
						
				</div>
			</div>

<%@include file="/jsp/public/footer.jsp" %>
			<%@include file="/jsp/public/js_includes.jsp" %>

			<script src="/js/galleria/galleria.js"></script>
			<script>Galleria.loadTheme('/js/galleria/galleria.classic.js');</script>
			<script src="http://connect.facebook.net/en_US/all.js"></script>

			<script type="text/javascript">
				$(document).ready(function(){

					//arg.weather();
					//arg.geolocation();
					arg.loginDialog();
					arg.subscribe();
					arg.editProfile();
					$('#galleria').galleria();
					
					var FBKey = '10bd5c5fac776ef90a635a6a0b475c2f';
					FB.init({apiKey: FBKey, status: true, cookie: true, xfbml: true});
					
					var errorm = '${errormessage}';
					if(errorm != ''){
						alert('${errormessage}');
					}
				});
				
			</script>
		</div>
		</body>
</html>